#include "StdAfx.h"
#include "ManagerCDockablePane.h"
#include "AddParticleWnd.h"
basePane * gpane = NULL;
ManagerCDockablePane::ManagerCDockablePane(void)
{
	basePane * gpane = new AddParticleWnd();
	addPane(gpane);
}

ManagerCDockablePane::~ManagerCDockablePane(void)
{
	deletePane(gpane);
}

void ManagerCDockablePane::addPane(basePane * pane)
{
	m_PaneList.push_back(pane);
}

void ManagerCDockablePane::deletePane(basePane * pane)
{
	PaneList::iterator i;
	i = find(m_PaneList.begin(),m_PaneList.end());
	if (i!=  m_PaneList.end())
	{
		delete *i;
		m_PaneList.erase(i);
	}
}

void	ManagerCDockablePane::CreateDockingWindows(CDockablePane* pTabControlBarAttachTo)
{
	for (int i = 0;i < m_PaneList.size(); i++)
	{
		m_PaneList.at(i)->CreateDockingWindows(pTabControlBarAttachTo);
	}
}

void	ManagerCDockablePane::SetupOgre()
{
	for (int i = 0;i < m_PaneList.size(); i++)
	{
		m_PaneList.at(i)->SetupOgre();
	}
}

void	ManagerCDockablePane::ShowPane(String &name)
{
	for (int i = 0;i < m_PaneList.size(); i++)
	{
		//m_PaneList.at(i)->ShowPane();
	}
}
void	ManagerCDockablePane::OnPaint()
{
	for (int i = 0;i < m_PaneList.size(); i++)
	{
		m_PaneList.at(i)->OnPaint();
	}
}

void	ManagerCDockablePane::ReloadUserResources() 
{

}

void	ManagerCDockablePane::TerminateScene() 
{

}